package com.howard.dao;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.howard.entity.User;

/**
 * User Dao Interface
 * @author Howard.He
 *
 */
public interface UserDao {

	/**
	 * add a user
	 * @param user User
	 * @return id long
	 * @throws DataAccessException
	 *
	 */
	long insertUser(User user) throws DataAccessException, IllegalAccessException, InvocationTargetException, NoSuchMethodException;
	/**
	 * batch add user
	 * @param users List<User>
	 * @return id collection long[]
	 * @throws DataAccessException
	 *
	 */
	int[] insertBatchUsers(List<User> users) throws DataAccessException;
	/**
	 * batch add user
	 * @param user User[]
	 * @return id collection long[]
	 * @throws DataAccessException
	 */
	int[] insertBatchUsers(User[] users) throws DataAccessException;

	User updateUser(User user) throws DataAccessException;
	void deleteUser(long userId) throws DataAccessException;
	void deleteAllUsers() throws DataAccessException;
	void deleteUser(User user) throws DataAccessException;
	List<User> queryUserForList() throws DataAccessException;
	List<User> queryUserForList(String status) throws DataAccessException;
	User queryUserById(final long id) throws DataAccessException;
	User queryUserByName(String accountName) throws DataAccessException;
}
